<script>
	$(function() {
		$("button, input:submit, a").button();
		$("a").click(function() { return true; });
	});
</script>
<table class="ui-widget ui-widget-content ui-corner-all" width="300" border="0" cellspacing="0">
    <tr class="ui-widget-header">        
        <td align="left" valign="center"><a href="<?php echo url::base()?>/patient/contract?p_id=<?php echo $p_id ?>" style="height: 36px;width: 50px;vertical-align: middle"><?php echo html::image('assets/icon/arrow_left_green_48.png',array('width' => '24', 'height' => '24','border'=>'0'))?></a>  กรุณาเลือกคุณหมอ</td>
    </tr>
</table>
<div style="width: 293px;height: 90%;overflow:auto;padding-left: 5px;background-color:white;border: 1px solid silver;" align="left"><br>
     <?php
           foreach($doctors as $doctor) {
               echo "<table width='95%' class=\"ui-widget ui-widget-content ui-corner-all\">";
               echo "<tr><td>ชื่อ</td><td>".$doctor["consult_doctor_name"]."</td></tr>";
               echo "<tr><td>รพ.</td><td>".$doctor["consult_doctor_hospital"]."</td></tr>";
               echo "<tr><td>สถานะ</td>";
               if($doctor["consult_doctor_status"]=="Online"){
                    echo "<td>".html::image('assets/icon/circle_green.png',array('width' => '48', 'height' => '48','border'=>'0'))."</td></tr>";
                    echo "<tr><td align='center' colspan='2'>
                         <a href='".URL::base()."patient/waiting?c_id=".$c_id."&p_id=".$p_id."&consult_doctor_id=".$doctor["consult_doctor_id"]."' class='ui-button ui-widget ui-state-default ui-corner-all' style='vertical-align: top;height:50px' target=''>".html::image('assets/icon/lightbulb_48.png',array('width' => '36', 'height' => '36','border'=>'0'))."ขอคำปรึกษา</a>
                         </td></tr>";
               }elseif($doctor["consult_doctor_status"]=="Busy"){
                   echo "<td>".html::image('assets/icon/circle_orange.png',array('width' => '48', 'height' => '48','border'=>'0'))."</td></tr>";
               }else{
                   echo "<td>".html::image('assets/icon/circle_red.png',array('width' => '48', 'height' => '48','border'=>'0'))."</td></tr>";
               }
               echo "</table>";
               echo "<br>";               
           }
     ?>
</div>


    
